rem This bat file accepts the RallyDesk checked out folder path and the output folder path
rem This reuires msbuild to run

@echo OFF
cls
rem if no parameters are given then raise error
IF "%1"=="" GOTO RAISE_ERROR 
IF "%2"=="" GOTO RAISE_ERROR 

rem here handle the build process.
SET RallyDeskPath=%1
SET RallyDeskBuildPath=%2


rem Compiling RallyDesk


@echo ---------------------
@echo Compiling RallyDeskCustomAction
@echo ---------------------
@echo %RallyDeskPath%

msbuild "%RallyDeskPath%\Rally Dekstop\RallyDeskCustomAction\RallyDeskCustomAction.csproj" /t:Rebuild /p:Configuration=Release;OutDir=bin\Release\


@echo ---------------------
@echo Compiling RallyDekstop
@echo ---------------------

msbuild "%RallyDeskPath%\Rally Dekstop\Rally Dekstop\Rally Dekstop.csproj" /t:Rebuild /p:Configuration=Release;OutDir=bin\Release\


@echo -------------------------------------
@echo Building Rally Desk.msi
@echo -------------------------------------
devenv "%RallyDeskPath%\Rally Dekstop\Rally Desk\Rally Desk.vdproj" /Rebuild Release



@echo --------------------------------------------------
@echo Copying files to Destination...
@echo --------------------------------------------------

mkdir %RallyDeskBuildPath%
rem C:\Projects\Rally\Rally Dekstop\Rally Desk\Release

copy "%RallyDeskPath%\Rally Dekstop\Rally Desk\Release\*.*" %RallyDeskBuildPath%

@echo ----------------------------------------------------------------------
@echo File sucessfully copied to %RallyDeskBuildPath%
@echo -----------------------------------------------------------------------

GOTO END
 
:RAISE_ERROR
@echo Incorrect Parameters !!!
@echo Usage -- RallyBuild [Source Code Path] [Path where build needs to be copied]

:END 

